<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/mobile/main.css" media="all" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/mobile/style.css" media="all" />
<link rel="stylesheet" href="__PUBLIC__/css/mobile/iconfont/iconfont.css" type="text/css">
<style type="text/css">
	li{margin-left: 20px;line-height: 25px;font-size: 18px;}
	li label{}
	.twoSt{height: 20px;width:20px;margin-top: 5px;}
</style>
<!--header页头文件-->
<div class="main wd_zl">
	<ul>
		<input type="hidden" name="id_one" name="id1" value="{$id}">
		<foreach name="two_status" item="ts">
			<!-- <input type="hidden" id="stTwo{$ts.id}" name="id" value=""> -->
			<li><input class="twoSt stTwo{$ts.id}" onclick="go_three_status(this)" id="{$ts.id}" data-next="{$ts.is_next}" type="radio" name="statustwo" value=""><label>&nbsp;{$ts.name}</label></li>
		</foreach>
	</ul>	
	
</div>
<div class="device-foot clear">
	<a onclick="status_ok()" id="submit" class="btn btn-primary">提交</a>
</div>
<script src="__PUBLIC__/js/jquery-1.10.1.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">
	function go_three_status(obj){
		var is_next = $(obj).attr("data-next");
		var is_choose =$(obj).attr("checked");
		if (is_choose == 'checked') {
			$(obj).val('1');
		}else{
			$(obj).val("");
			return false;
		}
		if (is_next == 1) {
			var id = $(obj).attr("id");
			var url = '__MODULE__/Glue/status_3/id/' + id;
			layer.open({
			  	type: 2,
			  	area: ['100%', '90%'],
			  	fixed: false, //不固定
			  	maxmin: true,
			  	content: url
			});
		}
		return false;
	}
	function status_ok(){
		var index = parent.layer.getFrameIndex(window.name);
		var stTwo = {};var temp={};var isemp=0;

		var val=$('input:radio[name="statustwo"]:checked').val();
		if(val != null){
			isemp = 1
			if(val == 1){
				stTwo[$('input:radio[name="statustwo"]:checked').attr('id')] = val;
			}else{
				temp = JSON.parse(unescape(val));
				stTwo[$('input:radio[name="statustwo"]:checked').attr('id')] = temp;
			}
		}
		/*$('input.twoSt').each(function(){
			if (this.value != "") {
				isemp = isemp + 1;
				if (this.value == "1") {
					stTwo[this.id] = this.value;
				}else{
					temp = JSON.parse(unescape(this.value));
					stTwo[this.id] = temp;
				}
			}
		});
		*/
		if (isemp != 0) {
			parent.$("#OneSt{$id}").val(escape(JSON.stringify(stTwo)));
		}
		//关闭窗口
		parent.layer.close(index);
		return false;
	}

</script>